import React from "react";

class EventBind extends React.Component {
  handerClick = (e) => {
    // console.log(e);
    // 阻止浏览器的默认行为
    e.preventDefault();
    console.log("a标签的事件被触发");
  };

  render() {
    return (
      <div>
        <a href="http://www.itheima.com" onClick={this.handerClick}>
          点击我
        </a>
      </div>
    );
  }
}

export default EventBind;
